<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Json</title>
</head>
<body>

</body>
<script>
    //json 数据格式(key:value...)
    /*let userList=[{username:"admin",pwd:"123",age:"1"},{username:"admin",pwd:"123",age:1}];
    alert(userList[0].username);*/

    //先转换再获取
    let user='{"username":"admin","pwd":"123","age":"1"}';
    let user1 =JSON.parse(user);
    alert(user1.username);

</script>


</html>